<style type="text/css">
    #fieldlist dd {display:block;margin:5px 0;}
    #fieldlist dd input{display: inline-block;width:300px;}
    #fieldlist dd input:first-child{width:110px;}
    #fieldlist dd ins{width:110px;display: inline-block;text-decoration:none;font-weight: bold;}
</style>
{php}$method = think\Request::instance()->action();{/php}
<form id="edit-form" class="form-horizontal form-ajax" role="form" data-toggle="validator" method="POST" action="">
    {if condition="$method eq 'add'"}
    <div class="form-group">
        <label for="c-modle" class="control-label col-xs-12 col-sm-2">缓存模板:</label>
        <div class="col-xs-12 col-sm-8">
            <button type="button" class="btn btn-success readcache" data-url="{:url('review/readcache')}">读取缓存配置</button>
        </div>
    </div>
	{/if}

    <div class="form-group">
        <label for="c-basic_id" class="control-label col-xs-12 col-sm-2">{:__('Basic_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-basic_id" data-rule="required" class="form-control" name="row[basic_id]" type="text" value="{$row.basic_id|default=''}">
        </div>
    </div>

    <div class="form-group">
        <label for="c-bar_code" class="control-label col-xs-12 col-sm-2">{:__('Bar_code')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-bar_code" data-rule="required" class="form-control" name="row[bar_code]" type="number" value="{$row.bar_code|default=''}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-product_name" class="control-label col-xs-12 col-sm-2">{:__('Product_name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-product_name" data-rule="required" class="form-control" name="row[product_name]" type="text" value="{$row.product_name|default=''}">
        </div>
    </div>
    <div class="form-group">
        <label for="content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <dl id="fieldlist" data-field="content" rel="{$row.content|default=''|count}">
                <dd>
                    <ins>{:__('Key')}</ins>
                    <ins>{:__('Value')}</ins>
                </dd>
				<!--{ php}$arr = json_decode($row['configure']);dump($arr);die;{ /php}-->
				{notempty name="row['content']"}
				{if condition="$method eq 'edit'"}
				{php}$arr = json_decode($row['content']);{/php}
                {foreach $arr as $key => $vo}
                <dd class="form-inline">
                    <input type="text" name="field[content][{$key}]" class="form-control" id="field-{$key}" value="{$key}" size="10" />
                    <input type="text" name="value[content][{$key}]" class="form-control" id="value-{$key}" value="{$vo}" size="40" />
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                    <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                </dd>
                {/foreach}
				{/if}
				{/notempty}
                <dd><a href="javascript:;" class="append btn btn-sm btn-success"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
            </dl>
        </div>
    </div>
	<div class="form-group">
        <label for="c-images" class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="form-inline">
                <input id="c-images" required="" class="form-control" size="50" name="row[images]" type="text" value="{$row.images|default=''}">
                <span><button type="button" id="plupload-images" class="btn btn-danger plupload" data-input-id="c-images" data-mimetype="image/*" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                <ul class="row list-inline plupload-preview" id="p-images"></ul>
            </div>
        </div>
    </div>
	<div class="form-group">
        <label for="place_record" class="control-label col-xs-12 col-sm-2">{:__('place_record')}:</label>
        <div class="col-xs-12 col-sm-8">
            <dl id="fieldlist" data-field="place_record" rel="{$row.place_record|default=''|count}">
                <dd>
                    <ins>{:__('Key')}</ins>
                    <ins>{:__('Value')}</ins>
                </dd>
				<!--{ php}$arr = json_decode($row['configure']);dump($arr);die;{ /php}-->
				{notempty name="row['place_record']"}
				{if condition="$method eq 'edit'"}
				{php}$arr = json_decode($row['place_record']);{/php}
                {foreach $arr as $key => $vo}
                <dd class="form-inline">
                    <input type="text" name="field[place_record][{$key}]" class="form-control" id="field-{$key}" value="{$key}" size="10" />
                    <input type="text" name="value[place_record][{$key}]" class="form-control" id="value-{$key}" value="{$vo}" size="40" />
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                    <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                </dd>
                {/foreach}
				{/if}
				{/notempty}
                <dd><a href="javascript:;" class="append btn btn-sm btn-success"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
            </dl>
        </div>
    </div>
	<div class="form-group">
        <label for="farming_record" class="control-label col-xs-12 col-sm-2">{:__('Farming_record')}:</label>
        <div class="col-xs-12 col-sm-8">
            <dl id="fieldlist" data-field="farming_record" rel="{$row.farming_record|default=''|count}">
                <dd>
                    <ins>{:__('Key')}</ins>
                    <ins>{:__('Value')}</ins>
                </dd>
				<!--{ php}$arr = json_decode($row['configure']);dump($arr);die;{ /php}-->
				{notempty name="row['farming_record']"}
				{if condition="$method eq 'edit'"}
				{php}$arr = json_decode($row['farming_record']);{/php}
                {foreach $arr as $key => $vo}
                <dd class="form-inline">
                    <input type="text" name="field[farming_record][{$key}]" class="form-control" id="field-{$key}" value="{$key}" size="10" />
                    <input type="text" name="value[farming_record][{$key}]" class="form-control" id="value-{$key}" value="{$vo}" size="40" />
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                    <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                </dd>
                {/foreach}
				{/if}
				{/notempty}
                <dd><a href="javascript:;" class="append btn btn-sm btn-success"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
            </dl>
        </div>
    </div>
	<div class="form-group">
        <label for="production_record" class="control-label col-xs-12 col-sm-2">{:__('Production_record')}:</label>
        <div class="col-xs-12 col-sm-8">
            <dl id="fieldlist" data-field="production_record" rel="{$row.production_record|default=''|count}">
                <dd>
                    <ins>{:__('Key')}</ins>
                    <ins>{:__('Value')}</ins>
                </dd>
				<!--{ php}$arr = json_decode($row['configure']);dump($arr);die;{ /php}-->
				{notempty name="row['production_record']"}
				{if condition="$method eq 'edit'"}
				{php}$arr = json_decode($row['production_record']);{/php}
                {foreach $arr as $key => $vo}
                <dd class="form-inline">
                    <input type="text" name="field[production_record][{$key}]" class="form-control" id="field-{$key}" value="{$key}" size="10" />
                    <input type="text" name="value[production_record][{$key}]" class="form-control" id="value-{$key}" value="{$vo}" size="40" />
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                    <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                </dd>
                {/foreach}
				{/if}
				{/notempty}
                <dd><a href="javascript:;" class="append btn btn-sm btn-success"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
            </dl>
        </div>
    </div>
	
	<div class="form-group">
        <label for="fertilizer_record" class="control-label col-xs-12 col-sm-2">{:__('Fertilizer_record')}:</label>
        <div class="col-xs-12 col-sm-8">
            <dl id="fieldlist" data-field="fertilizer_record" rel="{$row.fertilizer_record|default=''|count}">
                <dd>
                    <ins>{:__('Key')}</ins>
                    <ins>{:__('Value')}</ins>
                </dd>
				<!--{ php}$arr = json_decode($row['configure']);dump($arr);die;{ /php}-->
				{notempty name="row['fertilizer_record']"}
				{if condition="$method eq 'edit'"}
				{php}$arr = json_decode($row['fertilizer_record']);{/php}
                {foreach $arr as $key => $vo}
                <dd class="form-inline">
                    <input type="text" name="field[fertilizer_record][{$key}]" class="form-control" id="field-{$key}" value="{$key}" size="10" />
                    <input type="text" name="value[fertilizer_record][{$key}]" class="form-control" id="value-{$key}" value="{$vo}" size="40" />
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                    <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                </dd>
                {/foreach}
				{/if}
				{/notempty}
                <dd><a href="javascript:;" class="append btn btn-sm btn-success"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
            </dl>
        </div>
    </div>
	
	<div class="form-group">
        <label for="pesticides_record" class="control-label col-xs-12 col-sm-2">{:__('Pesticides_record')}:</label>
        <div class="col-xs-12 col-sm-8">
            <dl id="fieldlist" data-field="pesticides_record" rel="{$row.pesticides_record|default=''|count}">
                <dd>
                    <ins>{:__('Key')}</ins>
                    <ins>{:__('Value')}</ins>
                </dd>
				<!--{ php}$arr = json_decode($row['configure']);dump($arr);die;{ /php}-->
				{notempty name="row['pesticides_record']"}
				{if condition="$method eq 'edit'"}
				{php}$arr = json_decode($row['pesticides_record']);{/php}
                {foreach $arr as $key => $vo}
                <dd class="form-inline">
                    <input type="text" name="field[pesticides_record][{$key}]" class="form-control" id="field-{$key}" value="{$key}" size="10" />
                    <input type="text" name="value[pesticides_record][{$key}]" class="form-control" id="value-{$key}" value="{$vo}" size="40" />
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                    <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                </dd>
                {/foreach}
				{/if}
				{/notempty}
                <dd><a href="javascript:;" class="append btn btn-sm btn-success"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
            </dl>
        </div>
    </div>
	
	<div class="form-group">
        <label for="testing_record" class="control-label col-xs-12 col-sm-2">{:__('Testing_record')}:</label>
        <div class="col-xs-12 col-sm-8">
            <dl id="fieldlist" data-field="testing_record" rel="{$row.testing_record|default=''|count}">
                <dd>
                    <ins>{:__('Key')}</ins>
                    <ins>{:__('Value')}</ins>
                </dd>
				<!--{ php}$arr = json_decode($row['configure']);dump($arr);die;{ /php}-->
				{notempty name="row['testing_record']"}
				{if condition="$method eq 'edit'"}
				{php}$arr = json_decode($row['testing_record']);{/php}
                {foreach $arr as $key => $vo}
                <dd class="form-inline">
                    <input type="text" name="field[testing_record][{$key}]" class="form-control" id="field-{$key}" value="{$key}" size="10" />
                    <input type="text" name="value[testing_record][{$key}]" class="form-control" id="value-{$key}" value="{$vo}" size="40" />
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                    <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                </dd>
                {/foreach}
				{/if}
				{/notempty}
                <dd><a href="javascript:;" class="append btn btn-sm btn-success"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
            </dl>
        </div>
    </div>
    <div class="form-group">
        <label for="c-status" class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            {if condition="$method eq 'edit'"}
			{:build_radios('row[status]', ['normal' => __('Normal'),'hidden' => __('Hidden')], $row.status)}
			{else /}
			{:build_radios('row[status]', ['normal' => __('Normal'),'hidden' => __('Hidden')], 'normal')}
			{/if}
        </div>
    </div>
	<div class="form-group">
        <label for="c-note" class="control-label col-xs-12 col-sm-2">{:__('Note')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-note" data-rule="required" class="form-control" name="row[note]" type="text" value="{$row.note|default=''}">
        </div>
    </div>
    <div class="form-group hide layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
